#pragma once

#include <glad/glad.h>
#include <GLFW/glfw3.h>

#include "bglLayerStack.h"

class BGLApplication
{
private:
    GLFWwindow* m_window;

    BGLLayerStack m_layerStack;
    
private:
    void __init();
    void __render();

    void __setCallback();
protected:
    virtual void Init() = 0;;
    virtual void Render() = 0;

public:
    BGLApplication();
    ~BGLApplication();

    void PushLayer(BGLLayer* layer);
    void PushOverlay(BGLLayer* layer);

    void Run();

    void GetWindowSize(int* width, int* height);
    void GetWindowPos (int* xPos,  int* yPos);

    void SetWindowSize(int width, int height);
    void SetWindowPos (int xPos,  int yPos);
   
    virtual void FramebufferSizeCallback(GLFWwindow* window, int width, int height);
    virtual void ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
    virtual void CursorPositionCallback(GLFWwindow * window, double xpos, double ypos);
    virtual void MousebuttonCallback(GLFWwindow* window, int button, int action, int mods);
    virtual void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
};